(library (grammar-basics)
  (export NUMBER
          SPACE
          COMMA
          ARROW
          ANYTHING-EXCEPT-SPACE)
  (import (except (rnrs base)
                  let-values
                  map
                  error
                  vector-map)
          (only (guile)
                lambda* λ)
          ;; standard library
          (ice-9 peg))

  (define-peg-pattern NUMBER body (and (? (or "-" "+")) (+ (range #\0 #\9))))
  (define-peg-pattern SPACE none " ")
  (define-peg-pattern COMMA none ",")
  (define-peg-pattern ARROW none "->")
  (define-peg-pattern ANYTHING-EXCEPT-SPACE body
    (* (and (not-followed-by SPACE) peg-any))))
